<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>C++ Tutorial: String</title>
  <meta
 content="C++ Tutorial: String"
 name="description" />
  <meta
 content="C++ Tutorial, string, c_str()"
 name="keywords" />
  <meta http-equiv="Content-Type"
 content="text/html; charset=ISO-8859-1" />
  <link type="text/css" rel="stylesheet" href="../images/bogostyleWidePre.css" />
</head>
<body>
<div id="page" align="center">
<div id="content" style="width: 800px;">
<div id="logo">
<div class="whitetitle" style="margin-top: 70px;">bogotobogo </div>
</div>
<div id="topheader">
<div class="headerbodytext" align="left"><br />
<strong>Bogotobogo</strong><br />
contact@bogotobogo.com </div>
<div class="smallgraytext" id="toplinks"><a href="../index.html">Home</a>
| <a href="../sitemap.html">Sitemap</a>
| <a href="../blog" target="_blank">Contact Us</a>
</div>
</div>
<div id="menu">
<div class="smallwhitetext" style="padding: 9px;" align="right"><a
 href="../index.html">Home</a>
| <a href="../about_us.html">About Us</a>
| <a href="../products.html">Products</a>
| <a href="../our_services.html">Our Services</a>
| <a href="../blog" target="_blank">Contact Us</a>
</div>
</div>
<div id="submenu">
<div class="smallgraytext" style="padding: 9px;" align="right">
<a href="../gif.html">Gif</a> 
|<a href="../java_applet.html">JavaApplet/Web Start</a>
| <a href="../flash.html">Flash</a>
| <a href="../shockwave.html">ShockWave</a>
| <a href="../svg.html">SVG</a>
| <a href="../iPhone.html">iPhone/iPad</a>
| <a href="../android.html">Android</a>
| <a href="../OnHTML5.html">HTML5</a>
| <a href="../Algorithms/algorithms.html">Algorithms</a>
| <a href="../News/NewsMain.html">News</a>
| <a href="../cplusplus/cpptut.html">C++</a>
| <a href="../Java/tutorial/on_java.html">Java</a>
| <a href="../php/phptut.html">PHP</a>
| <a href="../DesignPatterns/introduction.html">Design Patterns</a>
| <a href="../python/pytut.html">Python</a> 
| <a href="../CSharp/.netframework.html">C#</a>
| <a href="../forums.html">Forums</a> 
| <a href="../VisualBasicSQL/introduction.html">Visual Basic</a>
</div>
</div>

<div id="contenttext">

<!-- Use of this code assumes agreement with the Google Custom Search Terms of Service. -->
<!-- The terms of service are available at http://www.google.com/cse/docs/tos.html -->
<form name="cse" id="searchbox_demo" action="http://www.google.com/cse">
  <input type="hidden" name="cref" value="" />
  <input type="hidden" name="ie" value="utf-8" />
  <input type="hidden" name="hl" value="" />
  <input name="q" type="text" size="40" />
  <input type="submit" name="sa" value="Search" />
</form>
<script type="text/javascript" src="http://www.google.com/cse/tools/onthefly?form=searchbox_demo&lang="></script>

<div id="bookmarkshare">
<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
<a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;username=khhong7"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=khhong7"></script>
</div>

<br />
<div style="padding: 10px;"><span class="titletext">C++ Tutorial - String</span></div>
<img src="../images/cplusplus/cpp_logo.jpg" alt="cplusplus logo"/>

<div class="bodytext" style="padding: 12px;" align="justify"> 
<div class="subtitle_2nd" id="FullList">Full List of C++ Tutorials</div>
<ul>
   <li><a href="cpptut.html">C++ Home</a> </li>
   <li><a href="string.html">String</a> </li>
   <li><a href="constructor.html">Constructor</a> </li>
   <li><a href="operatoroverloading.html">Operator Overloading</a> </li>
   <li><a href="virtualfunctions.html">Virtual Functions</a></li>
   <li><a href="dynamic_cast.html">Dynamic Cast Operator</a></li>
   <li><a href="typecast.html">Type Cast Operators</a></li>
   <li><a href="autoptr.html">Class auto_ptr</a></li>   
   <li><a href="templates.html">Templates</a></li>
   <li><a href="references.html">References for Built-in Types</a></li>
   <li><a href="valuevsreference.html">Pass by Value vs. Pass by Reference</a></li>
   <li><a href="memoryallocation.html">Memory Allocation</a></li>
   <li><a href="friendclass.html">Friend Functions and Friend Classes</a></li>
   <li><a href="functors.html">Functors (Function Objects)</a></li>
   <li><a href="statics.html">Static Variables and Static Class Members</a></li>
   <li><a href="exceptions.html">Exceptions</a></li>
   <li><a href="pointers.html">Pointers</a></li>
   <li><a href="pointers2.html">Pointers II</a></li>
   <li><a href="pointers3.html">Pointers III</a></li>
   <li><a href="assembly.html">Taste of Assembly</a></li>
   <li><a href="smallprograms.html">Small Programs</a></li>
   <li><a href="linkedlist.html">Linked List Examples</a></li>
   <li><a href="binarytree.html">Binary Tree Example Code</a></li>
   <li><a href="stl.html">Standard Template Library (STL)</a></li>
   <li><a href="stl2.html">Standard Template Library (STL) II - Maps</a></li>
   <li><a href="stl3_iterators.html">Standard Template Library (STL) III - Iterators</a></li>
   <li><a href="slicing.html">Object Slicing and Virtual Table</a></li>
   <li><a href="this_pointer.html">The this Pointer</a></li>
   <li><a href="stackunwinding.html">Stack Unwinding</a></li>
   <li><a href="upcasting_downcasting.html">Upcasting and Downcasting</a></li>
   <li><a href="object_returning.html">Object Returning</a></li>
   <li><a href="private_inheritance.html">Private Inheritance</a></li>
   <li><a href="cplusplus_keywords.html">C++_Keywords</a></li>
   <li><a href="multithreaded.html">Multi-Threaded Programming - Terminology</a></li>
   <li><a href="multithreaded2A.html">Multi-Threaded Programming II - Native Thread for Win32 (A) </a></li>
   <li><a href="multithreaded2B.html">Multi-Threaded Programming II -  Native Thread for Win32 (B) </a></li>
   <li><a href="multithreaded2C.html">Multi-Threaded Programming II -  Native Thread for Win32 (C) </a></li>
   <li><a href="multithreaded2.html">Multi-Threaded Programming II - C++ Thread for Win32</a></li>
   <li><a href="multithreaded3.html">Multi-Threaded Programming III - C++ Class Thread for Pthreads</a></li>
   <li><a href="multithreadedDebugging.html">Multithread Debugging</a></li>
   <li><a href="embeddedSystemsProgramming.html">Embedded Systems Programming</a></li>
   <li><a href="boost.html">Boost</a></li>
   <li>Programming Questions and Solutions
    <ul>
       <li><a href="quiz_strings_arrays.html">Strings and Arrays</a></li>
       <li><a href="quiz_linkedlist.html">Linked List</a></li>
       <li><a href="quiz_recursion.html">Recursion</a></li>
       <li><a href="quiz_bit_manipulation.html">Bit Manipulation</a> </li>
       <li><a href="google_interview_questions.html">140 Google Interview Questions</a> </li>
    </ul>
   </li>
</ul>
</div>
<br />
<br />
<img src="images/string/TongYoung.png" alt="TongYoung"/>
<br />
<br />

<div class="bodytext" style="padding: 12px;" align="justify">
<div class="subtitle" id="Cstring">String</div>
<p>C++ has two types of string: </p>
<ul>
	<li>C-style character string </li>
	<li>C++ &lt;string&gt; class which is Standard C++ string.</li>
</ul>
<p>In C, when we use the term <strong>string</strong>, we're referring to a variable length <strong>array of characters</strong>. It has a starting point and ends with a string-termination character. While C++ inherits this data structure from C, it also includes strings as a higher-level abstraction in the standard library. </p>
<p>The primary difference between a string and an array of characters revolves around <strong>length</strong>. Both representations share the same fact: they represent contiguous areas of memory. However, the length of an array is set at the creation time of the array whereas the length of a string may change during the execution of a program. This difference creates several implications, which we'll explore shortly.</p>
<br />
<br />
<div class="subtitle" id="Cstring">C string</div>
<p>Though the Standard C library is included as a part of Standard C++,
to use C library, we need to include the C header file:</p>
<pre>
#include &lt;cstring&gt;
</pre>
<p>C string is stored as a character array. Actually, a <strong>string</strong> is a series of characters stored in consecutive bytes of memory. The idea of a series of characters stored in consecutive bytes implies that we can store a string in an array of <strong>char</strong>, with each character kept in its own array element. </p> 
<p>C-style strings have a special feature: The last character of every string is the <strong>null character</strong>.</p>
<pre>
char non_string [10] = {'n','o','n','_','s','t','r','i','n','g'};
char a_string [9] = {'a','_','s','t','r','i','n','g','\0'};
</pre>
<p>Both of these are arrays of <strong>char</strong>, but only the second is a string (an array of 9 characters). So, the 8-character string requires a 9-character array. This scheme makes finding the length of the string an <strong>O(n)</strong> operation instead of <strong>O(1)</strong> operation. </p>
<p>
So, the <strong>strlen()</strong> must scan through the string until it finds the end. For the same reason that we can't assign one C array to another, we cannot copy C strings using '=' operator. Instead, we generally use the <strong>strcpy()</strong> function.</p>

<p>We manipulate the C string using a pointer. For example,<p>
<pre>
	const char *str ="I am a string";
</pre>
<p>we traverse it one by one each character:</p>
<pre>
	while(*str++){ }
</pre>
<p>The char* pointer <strong>str</strong> is dereferenced, and the character addressed is checked if it's true or false(if it's null).</p>
<p>Since there are still many program situations which require understanding C-style string, we need to be familiar with the C-style string.</p>
<p>Let's find out how much we know about C-string using the examples below. Can you figure out what's wrong?</p>
<p><strong>Question 1</strong>
<pre>
	char *cstr1 = "hello";
	*(cstr1)='t';
</pre>
<p><strong>Question 2</strong>
<pre>
	char *cstr2;
	strcpy(cstr2, "hello");
	*(cstr2)='t';
</pre>
<p><strong>Question 3</strong>
<pre>
	char cstr3[100];
	cstr3 = "hello";
	*(cstr3)='t';
</pre>
<p><strong>Question 4</strong>
<pre>
	char cstr4[100] = "hello";
	*(cstr4)='t';
</pre>
<p><strong>Answer 1</strong> <br />
Compiles successfully.<br />
In run time, however, at the moment when it tries to write, it fails.<br />
We get this message:<br />
Unhandled exception at 0x00411baa in cstring.exe: 0xC0000005:<br />
Access violation writing location 0x0041783c.</p>
<p>
When our program is compiled, the compiler forms the object code file, which contains our machine code and a table of all the string constants declared in the program. In  the statement,
<pre>
char *cstr1 = "hello";
</pre>
causes <strong>cstr1</strong> to point to the address of the string <strong>hello</strong> in the string constant table. Since this string is in the string constant table, and therefore technically a part of the executable code, we cannot modify it. We can only point to it and use it in a read-only manner. </p>

<p><strong>Answer 2</strong> <br />
This code is compiled successfully. But
we need to allocate memory for the character pointer. <br />
The right code should look like this:
<pre>
	char *cstr2 = (char *)malloc(100);
	strcpy(cstr2,"hello");
	*(cstr2)='t';
</pre>

<p><strong>Answer 3</strong><br />
This won't compile. </p>
<p>At the line:
<pre>
cstr3 = "hello";
</pre>
we get the following message:<br />
cannot convert from 'const char [6]' to 'char [100]'</p>
<p>Since the string <strong>hello</strong>  exists in the constant table, we can copy it into the array of characters named <strong>cstr3</strong>. However, it is not a pointer, the statement
<pre> cstr3="hello";
</pre>
 will not work. </p>

<p><strong>Answer 4</strong><br />
No problem at all.</p>
<br />
<br />

<div class="subtitle_2nd" id="CstringLib">C Library Utilities</div>
<p>Standard C library gives us a set of utility functions such as:</p>
<pre>
	/*returns the length of the string*/
	int strlen(const char*);

	/*copies the 2nd string into the 1st*/
	char* strcpy(char*, const char*);

	/*compares two strings*/
	int strcmp(const char*, const char*) 
</pre>
<p>Some of the source code for the library utility functions can be found <a href="smallprograms.html">Small Programs</a>.</p>
<p>Because we manipulate the C string using pointer which is low-level operation, it's error prone. That's why we have C++ &lt;string&gt; class.</p>
<br />
<br />


<div class="subtitle" id="Cplusstring">C++ string</div>
<p>Though there are lots of advantages of C++ string over C string, we won't talk about it at this time. But because numerous codes still using C style string, we need to look at the conversion between them. Here is an example with some error messages we'll get if we run it as it is.</p>
<pre>
#include &lt;string&gt;
#include &lt;cstring&gt;

int main()
{
	using namespace std;
	string str1;
	const char *pc = "I am just a character array";

	// C++ string type automatically converting a C character string
	// into a string object. 
        // string class defines a char* - to-string conversion, which makes
        // it possible to initialize a string object to a C-style string.
      
	str1 = pc;   //ok


	// error C2440: 'initializing':
	// cannot convert from 'std::string' to 'char *'

	char *p1 = str1;  //not ok


	// error C2440: 'initializing' :
	// cannot convert from 'const char *' to 'char *'

	char *p2 = str1.c_str(); //not there yet


	const char *p3 = str1.c_str();  //ok


        // removing (casting) constantness 

        char *p4 = const_cast&lt;char *&gt; (str1.c_str());  // ok

	return 0;
}
</pre> 
<p>The <strong>c_str()</strong> returns a pointer to <strong>const array</strong> in order to prevent the array from being directly manipulated. That's why we need <strong>const</strong> qualifier in the example code.</p>
<br />
<br />


<div class="subtitle_2nd" id="stringoperations">String Operations</div>
<ul>
   <li><strong>s1=s2</strong>
    <p>Assign <strong>s2</strong> to <strong>s1</strong>; <strong>s2</strong> can be a <strong>string</strong> or a C-style <strong>string</strong>.</p>
   </li>
   <li><strong>s+=a</strong>
    <p>Add <strong>a</strong> at end; <strong>a</strong> can be a <strong>character</strong> or a C-style <strong>string</strong>.</p>
   </li>
   <li><strong>s[i]</strong>
    <p>subscripting</p>
   </li>
   <li><strong>s1+s2</strong>
    <p>Concatenation; the characters in the resulting <strong>string</strong> will be a copy of those from <strong>s1</strong> followed by a copy of those from <strong>s2</strong>.</p>
   </li>
   <li><strong>s1&lt;s2</strong>
    <p>Lexicographical comparison of <strong>string</strong> values; <strong>s1</strong> or <strong>s2</strong>, but not both, can be a C-style string.</p>
   </li>
   <li><strong>s1==s2</strong>
    <p>Comparison of <strong>string</strong> values; <strong>s1</strong> or <strong>s2</strong>, but not both, can be a C-style string.</p>
   </li>
   <li><strong>s.size()</strong>
    <p>Number of characters in <strong>s</strong>.</p>
   </li>
   <li><strong>s.length()</strong>
    <p>Number of characters in <strong>s</strong>.</p>
   </li>
   <li><strong>s.c_str()</strong>
    <p>C-style version of characters in <strong>s</strong>.</p>
   </li>
   <li><strong>s.begin()</strong>
    <p>Iterator to first character.</p>
   </li>
   <li><strong>s.end()</strong>
    <p>Iterator to one beyond the end of <strong>s</strong>.</p>
   </li>
   <li><strong>s.insert(pos,a)</strong>
    <p>Insert <strong>a</strong> before <strong>s[pos]</strong>; <strong>a</strong> can be a character, a <strong>string</strong>, or a C-style string. <strong>s</strong> expands to make room for the characters from <strong>a</strong>.</p>
   </li>
   <li><strong>s.append(pos,a)</strong>
    <p>Insert <strong>a</strong> after <strong>s[pos]</strong>; <strong>a</strong> can be a character, a <strong>string</strong>, or a C-style string. <strong>s</strong> expands to make room for the characters from <strong>a</strong>.</p>
   </li>
   <li><strong>s.erase(pos)</strong>
    <p>Remove the character in <strong>s[pos]</strong>; <strong>s</strong>'s size decreases by 1.</p>
   </li>
   <li><strong>pos=s.find(a)</strong>
    <p>Find <strong>a</strong> in <strong>s</strong>; <strong>a</strong> can be a character, a <strong>string</strong>, or a C-style string. <strong>pos</strong> is the index of the first character found, or <strong>npos</strong> (a position off the end of <strong>s</strong>.</p>
   </li>
   <li><strong>in >> s</strong>
    <p>Read a whitespace-separated word into <strong>s</strong> from <strong>in</strong>.</p>
   </li>
   <li><strong>getline(in,s)</strong>
    <p>Read a line into <strong>s</strong> from <strong>in</strong>.</p>
   </li>
   <li><strong>out << s</strong>
    <p>Write from <strong>s</strong> to <strong>out</strong>.</p>
   </li>
</ul>

<br />
<br />


<div class="subtitle" id="pointerandstrings">Pointers and Strings</div>
<p>Take a look at the following code:</p>
<pre>
char name[12] = "Alan Turing";
std::cout << name << " is one of the greatest.\n";
</pre>
<p>The name of an array is the address of its first element. The  <strong>name</strong> in the <strong>cout</strong> is the address of the <strong>char</strong> element containing the character <strong>A</strong>. The <strong>cout</strong> object assumes that the address of a <strong>char</strong> is the address of a string. So, it prints the character at that address and then continues printing characters until it meets the null character, <strong>'\0'</strong>.</p>
<p>In other words, a C string is nothing more than a char array. Just as C doesn't track the size of arrays, it doesn't track the size of strings. Instead, the end of the string is marked with a null character, represented in the language as '\0'. So, if we give the <strong>cout</strong> the address of a character, it prints everything from that character to the first null character that follows it.</p>
<p>The key here is that <strong>name</strong> acts as the address of a <strong>char</strong> which implies that we can use a pointer-to-<strong>char</strong> variable as an argument to <strong>cout</strong>. </p>
<p>What about the other part of the <strong>cout</strong> statement?<br /> If <strong>name</strong> is actually the address of the first character of a string, what is the expression <strong>" is one of the greatest.\n"</strong>? To be consistent with <strong>cout</strong>'s handling of string output, this quoted string should also be an address. Yes, it is. A quoted string serves as the address of its first element.</p> 
<p>It doesn't really send a whole string to <strong>cout</strong>. It just sends the string address. This means:
<ul>
	<li>strings in an array</li>
	<li>quoted string constants</li>
	<li>strings described by pointers</li>
</ul>
are all handled equivalently. Each of them is really passed along as an address. </p>  
<p>The following example shows how we use different forms of strings. It uses two functions from the string library, strlen() and strcpy().
Prototypes of the functions are in <strong>cstring</strong> header file.</p>
<pre>
#include &lt;iostream&gt;
#include &lt;cstring&gt;

int main()
{
	using namespace std;

	char nameArr[12] = "Alan Turing";
	const char *namePtrConstChar = "Edsger W. Dijkstra";
	char *ptr;

	cout << nameArr << " and " << namePtrConstChar << endl;
	cout << endl;

	ptr = nameArr;

	cout << "1: " << nameArr << " @ " << (int *)nameArr << endl;
	cout << "1: " << ptr << " @ " << (int *) ptr << endl;
        cout << endl;

	ptr = new char[strlen(nameArr) + 1];
	strcpy(ptr, nameArr);
	cout << "2: " << nameArr << " @ " << (int *)nameArr << endl;
	cout << "2: " << ptr << " @ " << (int *) ptr << endl;

	delete [] ptr;
}
</pre> 
<p>Output from the run:</p>
<pre>
Alan Turing and Edsger W. Dijkstra

1: Alan Turing @ 0017FF1C
1: Alan Turing @ 0017FF1C

2: Alan Turing @ 0017FF1C
2: Alan Turing @ 007A1F20
</pre>
<p>The code above creates one <strong>char</strong> array, <strong>nameArr</strong> and two pointers-to-<strong>char</strong> variables, <strong>nameB</strong> and <strong>ptr</strong>. The code begins by initializing the <strong>nameArr</strong> to the <strong>"Alan Turing"</strong> string. Then, it initializes a pointer-to-<strong>char</strong> to a string:
<pre>
const char *namePtrConstChar = "Edsger W. Dijkstra";
</pre>
<p><strong>"Edsger W. Dijkstra"</strong> actually represents the address of the string, so this assigns the address of <p><strong>"Edsger W. Dijkstra"</strong> to the <strong>namePtrConstChar</strong> pointer. </p>
<p>String literals are <strong>constants</strong>, which is why the code uses the <strong>const</strong> keyword. Using <strong>const</strong> means we can use <strong>namePtrConstChar</strong> to access the string <strong>but not to change it</strong>.</p>
<p>The pointer <strong>ptr</strong> remains uninitialized, so it doesn't point to any string.</p>
<p>The code illustrates that we can use the array name <strong>nameArr</strong> and the pointer <strong>namePtrConstChar</strong> equivalently with <strong>cout</strong>. Both are the addresses of strings, and <strong>cout</strong> displays the two strings stored at those addresses. </p>
<p>Let's look at the following code of the example:</p>
<pre>
cout << "1: " << nameArr << " @ " << (int *)nameArr << endl;
cout << "1: " << ptr << " @ " << (int *) ptr << endl;
</pre>
<p>It produces the following output:</p>
<pre>
1: Alan Turing @ 0017FF1C
1: Alan Turing @ 0017FF1C
</pre>
<p>In general, if we give <strong>cout</strong> a pointer, it prints an address. But if the pointer is type <strong>char *</strong>, <strong>cout</strong> displays the pointed-to-string. If we want to see the address of the string, we should cast the pointer to another pointer type, such as <strong>int *</strong>. Thus, <strong>ptr</strong> displays as the string "Alan Turing", but <strong>(int *)ptr</strong> displays as the address where the string is located. Note that assigning <strong>nameArr</strong> to <strong>ptr</strong> does not copy the string, it copies the address. This results in the two pointers (<strong>nameArr</strong> and <strong>ptr</strong>) to the same memory location and string.</p>
<p>To get a copy of a string, we need to allocate memory to hold the string. We can do this:</p>
<ul>
	<li>declaring a second array</li>
	<li>using <strong>new</strong></li>
</ul>
<p>In the code, we use the second approach:</p>
<pre>
ptr = new char[strlen(nameArr) + 1];
</pre>
<p>Then, we copy a string from the <strong>nameArr</strong> to the newly allocated space. It doesn't work if we assign <strong>nameArr</strong> to <strong>ptr</strong> because it just changes the address stored in <strong>ptr</strong> and thus loses the information of the address of memory we just allocated. Instead, we need to use the <strong>strcpy()</strong>:</p>
<pre>
strcpy(ptr, nameArr);
</pre>
<p>The <strong>strcpy()</strong> function takes two arguments. The first is the destination address, and the second is the address of the string to be copied. Note that by using <strong>strcpy()</strong> and <strong>new</strong>, we get two separate copies of <strong>"Alan Turing"</strong>:</p>
<pre>
2: Alan Turing @ 0017FF1C
2: Alan Turing @ 007A1F20
</pre>


<br />
<p>Additional codes related to string manipulation samples which frequently appear at interviews are <a href="smallprograms.html">sources A</a>
and <a href="quiz_strings_arrays.html">sources B</a></p>
<br />
<br />
<img src="images/string/DoBong.png" alt="DoBong"/>
<br />
<br />
<br />
<br />

<div id="rightpanel">
<div align="center">
</div></div>

<br /><br />
<div class="subtitle_2nd" id="FullList">Full List of C++ Tutorials</div>
<ul>
   <li><a href="cpptut.html">C++ Home</a> </li>
   <li><a href="string.html">String</a> </li>
   <li><a href="constructor.html">Constructor</a> </li>
   <li><a href="operatoroverloading.html">Operator Overloading</a> </li>
   <li><a href="virtualfunctions.html">Virtual Functions</a></li>
   <li><a href="dynamic_cast.html">Dynamic Cast Operator</a></li>
   <li><a href="typecast.html">Type Cast Operators</a></li>
   <li><a href="autoptr.html">Class auto_ptr</a></li>
   <li><a href="templates.html">Templates</a></li>
   <li><a href="references.html">References for Built-in Types</a></li>
   <li><a href="valuevsreference.html">Pass by Value vs. Pass by Reference</a></li>
   <li><a href="memoryallocation.html">Memory Allocation</a></li>
   <li><a href="friendclass.html">Friend Functions and Friend Classes</a></li>
   <li><a href="functors.html">Functors</a></li>
   <li><a href="statics.html">Static Variables and Static Class Members</a></li>
   <li><a href="exceptions.html">Exceptions</a></li>
   <li><a href="pointers.html">Pointers</a></li>
   <li><a href="pointers2.html">Pointers II</a></li>
   <li><a href="pointers3.html">Pointers III</a></li>
   <li><a href="assembly.html">Taste of Assembly</a></li>
   <li><a href="smallprograms.html">Small Programs</a></li>
   <li><a href="linkedlist.html">Linked List Examples</a></li>
   <li><a href="binarytree.html">Binary Tree Example Code</a></li>
   <li><a href="stl.html">Standard Template Library (STL)</a></li>
   <li><a href="stl2.html">Standard Template Library (STL) II - Maps</a></li>
   <li><a href="stl3_iterators.html">Standard Template Library (STL) III - Iterators</a></li>
   <li><a href="slicing.html">Object Slicing and Virtual Table</a></li>
   <li><a href="this_pointer.html">The this Pointer</a></li>
   <li><a href="stackunwinding.html">Stack Unwinding</a></li>
   <li><a href="upcasting_downcasting.html">Upcasting and Downcasting</a></li>
   <li><a href="object_returning.html">Object Returning</a></li>
   <li><a href="private_inheritance.html">Private Inheritance</a></li>
   <li><a href="cplusplus_keywords.html">C++_Keywords</a></li>
   <li><a href="multithreaded.html">Multi-Threaded Programming - Terminology</a></li>
   <li><a href="multithreaded2A.html">Multi-Threaded Programming II - Native Thread for Win32 (A) </a></li>
   <li><a href="multithreaded2B.html">Multi-Threaded Programming II -  Native Thread for Win32 (B) </a></li>
   <li><a href="multithreaded2C.html">Multi-Threaded Programming II -  Native Thread for Win32 (C) </a></li>
   <li><a href="multithreaded2.html">Multi-Threaded Programming II - C++ Thread for Win32</a></li>
   <li><a href="multithreaded3.html">Multi-Threaded Programming III - C++ Class Thread for Pthreads</a></li>
   <li><a href="multithreadedDebugging.html">Multithread Debugging</a></li>
   <li><a href="embeddedSystemsProgramming.html">Embedded Systems Programming</a></li>
   <li><a href="boost.html">Boost</a></li>
   <li>Programming Questions and Solutions
    <ul>
       <li><a href="quiz_strings_arrays.html">Strings and Arrays</a></li>
       <li><a href="quiz_linkedlist.html">Linked List</a></li>
       <li><a href="quiz_recursion.html">Recursion</a></li>
       <li><a href="quiz_bit_manipulation.html">Bit Manipulation</a> </li>
       <li><a href="google_interview_questions.html">140 Google Interview Questions</a> </li>
    </ul>
   </li>
</ul>
<br /><br />



<br />


<br />
<br />
<br />


</div>
</div>
<div class="smallgraytext" id="footer"><a href="../index.html">Home</a>
| <a href="../about_us.html">About Us</a>
| <a href="../products.html">products</a>
| <a href="../our_services.html">Our Services</a>
| <a href="#">Contact Us</a>
| Bogotobogo &copy; 2011 | <a target="_blank" href="http://www.bogotobogo.com">Bogotobogo </a>
</div>
</div>
</div>
</body>
</html>
